tools: mkenvimage: Fix read() stdin error handling
authorAlexander Dahl <[email protected]>
Fri, 20 Apr 2018 13:29:30 +0000 (15:29 +0200)
committerTom Rini <[email protected]>
Sat, 28 Apr 2018 22:32:24 +0000 (18:32 -0400)
commit3559028cb2840cc283652f4b7e4e1b457e6ec6a5
tree51b991b8fd3be1921711e191b2217ebd254af3df
parent8dc4e1fbf439d63082419640b6e797dfdfcc4720
tools: mkenvimage: Fix read() stdin error handling

On success read() returns the number of bytes read or zero for EOF. On
error -1 is returned and errno is set, so the right way to test if read
had failed is to test the return value instead of errno.

Signed-off-by: Alexander Dahl <[email protected]>
tools/mkenvimage.c